package com.chapter_9;

/**
 * @Author: Timo
 * @Date: 2019/5/17 09:42
 * @Description: 类用途：
 */
public class RealData implements Data {
    private String content;

    public RealData(int count , char c) {
        System.out.println("     making Realdata("+count+","+c+") BEGIN");
        char[] buffer = new char[count];
        for (int i = 0; i < count; i++) {
            buffer[i] = c;
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("     making Realdata("+count+","+c+") END");
        this.content = new String(buffer);
    }

    @Override
    public String getContent() {
        return this.content;
    }
}
